﻿@using Aluetjen.EmailService.Domain.Models.Pipeline
@model IEnumerable<Transformation>

@{
    ViewBag.Title = "Transformations";
}

<h2>Transformations</h2>

<table>
    <tr>
        <th>
            Field
        </th>
        <th>
            Match
        </th>
        <th>
            Replacement
        </th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Field)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.MatchRegex)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ReplacementRegex)
        </td>
    </tr>
}

@if (Model.Count() == 0) {
    <tr>
        <td colspan="3">No transformations have been configured.</td>
    </tr>
}
</table>
